
<?php
$rs=getPortalMenu("null","ASC");
			?>
 <div  class="minisitemap"> 
 <table >
 <tr>
 <?php
          while ( !$rs->EOF)  { 
		  ?>

 <td class="firstlevel">
  <a href="<?php echo createNiceUrl("pageName",$rs->fields["name"])?>"><?php echo $rs->fields["title"]; ?></a>
 <?php

$rschild=getPortalMenu($rs->fields["id"],"DESC"); 
  $hasChilds=false;

  //echo "<script>alert('".$rschild->EOF."');</script>";
if (!$rschild->EOF){
$hasChilds=true;
?>


<?php
}
			?>
			
			<table class="secondlevel" >
 <?php
          while ( !$rschild->EOF)  { 
		  ?>
		  <tr>
 <td>
  <a href="<?php echo createNiceUrl("pageName",$rschild->fields["name"])?>"><?php echo $rschild->fields["title"]; ?></a> </td> </tr>
  				  <?php
		  $rschild->MoveNext();    
		  }
if ($hasChilds){
?>

<?php
}	
?>

</table>
   </td>
				  <?php
		  $rs->MoveNext();    
		  }
?>
</tr>
</table>
 </div>
 
 
 